<?php

require 'libs/rb-mysql.php';

R::setup( 'mysql:host=43.142.143.8;port=8306;dbname=bot', 'hunk7095', '123456' );


$countryCodeMap = [
    'AD' => ['en_name' => 'Andorra', 'name' => '安道尔'],
    'AE' => ['en_name' => 'United Arab Emirates', 'name' => '阿联酋'],
    'AF' => ['en_name' => 'Afghanistan', 'name' => '阿富汗'],
    'AG' => ['en_name' => 'Antigua and Barbuda', 'name' => '安提瓜和巴布达'],
    'AI' => ['en_name' => 'Anguilla', 'name' => '安圭拉'],
    'AL' => ['en_name' => 'Albania', 'name' => '阿尔巴尼亚'],
    'AM' => ['en_name' => 'Armenia', 'name' => '亚美尼亚'],
    'AO' => ['en_name' => 'Angola', 'name' => '安哥拉'],
    'AQ' => ['en_name' => 'Antarctica', 'name' => '南极洲'],
    'AR' => ['en_name' => 'Argentina', 'name' => '阿根廷'],
    'AS' => ['en_name' => 'American Samoa', 'name' => '美属萨摩亚'],
    'AT' => ['en_name' => 'Austria', 'name' => '奥地利'],
    'AU' => ['en_name' => 'Australia', 'name' => '澳大利亚'],
    'AW' => ['en_name' => 'Aruba', 'name' => '阿鲁巴'],
    'AX' => ['en_name' => 'Åland Islands', 'name' => '奥兰'],
    'AZ' => ['en_name' => 'Azerbaijan', 'name' => '阿塞拜疆'],
    'BA' => ['en_name' => 'Bosnia and Herzegovina', 'name' => '波黑'],
    'BB' => ['en_name' => 'Barbados', 'name' => '巴巴多斯'],
    'BD' => ['en_name' => 'Bangladesh', 'name' => '孟加拉国'],
    'BE' => ['en_name' => 'Belgium', 'name' => '比利时'],
    'BF' => ['en_name' => 'Burkina Faso', 'name' => '布基纳法索'],
    'BG' => ['en_name' => 'Bulgaria', 'name' => '保加利亚'],
    'BH' => ['en_name' => 'Bahrain', 'name' => '巴林'],
    'BI' => ['en_name' => 'Burundi', 'name' => '布隆迪'],
    'BJ' => ['en_name' => 'Benin', 'name' => '贝宁'],
    'BL' => ['en_name' => 'Saint Barthélemy', 'name' => '圣巴泰勒米'],
    'BM' => ['en_name' => 'Bermuda', 'name' => '百慕大'],
    'BN' => ['en_name' => 'Brunei Darussalam', 'name' => '文莱'],
    'BO' => ['en_name' => 'Bolivia, Plurinational State of', 'name' => '玻利维亚'],
    'BQ' => ['en_name' => 'Bonaire, Sint Eustatius and Saba', 'name' => '荷兰加勒比区'],
    'BR' => ['en_name' => 'Brazil', 'name' => '巴西'],
    'BS' => ['en_name' => 'Bahamas', 'name' => '巴哈马'],
    'BT' => ['en_name' => 'Bhutan', 'name' => '不丹'],
    'BV' => ['en_name' => 'Bouvet Island', 'name' => '布韦岛'],
    'BW' => ['en_name' => 'Botswana', 'name' => '博茨瓦纳'],
    'BY' => ['en_name' => 'Belarus', 'name' => '白俄罗斯'],
    'BZ' => ['en_name' => 'Belize', 'name' => '伯利兹'],
    'CA' => ['en_name' => 'Canada', 'name' => '加拿大'],
    'CC' => ['en_name' => 'Cocos (Keeling) Islands', 'name' => '科科斯（基林）群岛'],
    'CD' => ['en_name' => 'Congo, the Democratic Republic of the', 'name' => '刚果民主共和国'],
    'CF' => ['en_name' => 'Central African Republic', 'name' => '中非'],
    'CG' => ['en_name' => 'Congo', 'name' => '刚果共和国'],
    'CH' => ['en_name' => 'Switzerland', 'name' => '瑞士'],
    'CI' => ['en_name' => 'Côte d\'Ivoire', 'name' => '科特迪瓦'],
    'CK' => ['en_name' => 'Cook Islands', 'name' => '库克群岛'],
    'CL' => ['en_name' => 'Chile', 'name' => '智利'],
    'CM' => ['en_name' => 'Cameroon', 'name' => '喀麦隆'],
    'CN' => ['en_name' => 'China', 'name' => '中国'],
    'CO' => ['en_name' => 'Colombia', 'name' => '哥伦比亚'],
    'CR' => ['en_name' => 'Costa Rica', 'name' => '哥斯达黎加'],
    'CU' => ['en_name' => 'Cuba', 'name' => '古巴'],
    'CV' => ['en_name' => 'Cabo Verde', 'name' => '佛得角'],
    'CW' => ['en_name' => 'Curaçao', 'name' => '库拉索'],
    'CX' => ['en_name' => 'Christmas Island', 'name' => '圣诞岛'],
    'CY' => ['en_name' => 'Cyprus', 'name' => '塞浦路斯'],
    'CZ' => ['en_name' => 'Czechia', 'name' => '捷克'],
    'DE' => ['en_name' => 'Germany', 'name' => '德国'],
    'DJ' => ['en_name' => 'Djibouti', 'name' => '吉布提'],
    'DK' => ['en_name' => 'Denmark', 'name' => '丹麦'],
    'DM' => ['en_name' => 'Dominica', 'name' => '多米尼克'],
    'DO' => ['en_name' => 'Dominican Republic', 'name' => '多米尼加'],
    'DZ' => ['en_name' => 'Algeria', 'name' => '阿尔及利亚'],
    'EC' => ['en_name' => 'Ecuador', 'name' => '厄瓜多尔'],
    'EE' => ['en_name' => 'Estonia', 'name' => '爱沙尼亚'],
    'EG' => ['en_name' => 'Egypt', 'name' => '埃及'],
    'EH' => ['en_name' => 'Western Sahara', 'name' => '西撒哈拉'],
    'ER' => ['en_name' => 'Eritrea', 'name' => '厄立特里亚'],
    'ES' => ['en_name' => 'Spain', 'name' => '西班牙'],
    'ET' => ['en_name' => 'Ethiopia', 'name' => '埃塞俄比亚'],
    'FI' => ['en_name' => 'Finland', 'name' => '芬兰'],
    'FJ' => ['en_name' => 'Fiji', 'name' => '斐济'],
    'FK' => ['en_name' => 'Falkland Islands (Malvinas)', 'name' => '福克兰群岛'],
    'FM' => ['en_name' => 'Micronesia, Federated States of', 'name' => '密克罗尼西亚联邦'],
    'FO' => ['en_name' => 'Faroe Islands', 'name' => '法罗群岛'],
    'FR' => ['en_name' => 'France', 'name' => '法国'],
    'GA' => ['en_name' => 'Gabon', 'name' => '加蓬'],
    'GB' => ['en_name' => 'United Kingdom', 'name' => '英国'],
    'GD' => ['en_name' => 'Grenada', 'name' => '格林纳达'],
    'GE' => ['en_name' => 'Georgia', 'name' => '格鲁吉亚'],
    'GF' => ['en_name' => 'French Guiana', 'name' => '法属圭亚那'],
    'GG' => ['en_name' => 'Guernsey', 'name' => '根西'],
    'GH' => ['en_name' => 'Ghana', 'name' => '加纳'],
    'GI' => ['en_name' => 'Gibraltar', 'name' => '直布罗陀'],
    'GL' => ['en_name' => 'Greenland', 'name' => '格陵兰'],
    'GM' => ['en_name' => 'Gambia', 'name' => '冈比亚'],
    'GN' => ['en_name' => 'Guinea', 'name' => '几内亚'],
    'GP' => ['en_name' => 'Guadeloupe', 'name' => '瓜德罗普'],
    'GQ' => ['en_name' => 'Equatorial Guinea', 'name' => '赤道几内亚'],
    'GR' => ['en_name' => 'Greece', 'name' => '希腊'],
    'GS' => ['en_name' => 'South Georgia and the South Sandwich Islands', 'name' => '南乔治亚和南桑威奇群岛'],
    'GT' => ['en_name' => 'Guatemala', 'name' => '危地马拉'],
    'GU' => ['en_name' => 'Guam', 'name' => '关岛'],
    'GW' => ['en_name' => 'Guinea-Bissau', 'name' => '几内亚比绍'],
    'GY' => ['en_name' => 'Guyana', 'name' => '圭亚那'],
    'HK' => ['en_name' => 'Hong Kong', 'name' => '香港'],
    'HM' => ['en_name' => 'Heard Island and McDonald Islands', 'name' => '赫德岛和麦克唐纳群岛'],
    'HN' => ['en_name' => 'Honduras', 'name' => '洪都拉斯'],
    'HR' => ['en_name' => 'Croatia', 'name' => '克罗地亚'],
    'HT' => ['en_name' => 'Haiti', 'name' => '海地'],
    'HU' => ['en_name' => 'Hungary', 'name' => '匈牙利'],
    'ID' => ['en_name' => 'Indonesia', 'name' => '印度尼西亚'],
    'IE' => ['en_name' => 'Ireland', 'name' => '爱尔兰'],
    'IL' => ['en_name' => 'Israel', 'name' => '以色列'],
    'IM' => ['en_name' => 'Isle of Man', 'name' => '马恩岛'],
    'IN' => ['en_name' => 'India', 'name' => '印度'],
    'IO' => ['en_name' => 'British Indian Ocean Territory', 'name' => '英属印度洋领地'],
    'IQ' => ['en_name' => 'Iraq', 'name' => '伊拉克'],
    'IR' => ['en_name' => 'Iran, Islamic Republic of', 'name' => '伊朗'],
    'IS' => ['en_name' => 'Iceland', 'name' => '冰岛'],
    'IT' => ['en_name' => 'Italy', 'name' => '意大利'],
    'JE' => ['en_name' => 'Jersey', 'name' => '泽西'],
    'JM' => ['en_name' => 'Jamaica', 'name' => '牙买加'],
    'JO' => ['en_name' => 'Jordan', 'name' => '约旦'],
    'JP' => ['en_name' => 'Japan', 'name' => '日本'],
    'KE' => ['en_name' => 'Kenya', 'name' => '肯尼亚'],
    'KG' => ['en_name' => 'Kyrgyzstan', 'name' => '吉尔吉斯斯坦'],
    'KH' => ['en_name' => 'Cambodia', 'name' => '柬埔寨'],
    'KI' => ['en_name' => 'Kiribati', 'name' => '基里巴斯'],
    'KM' => ['en_name' => 'Comoros', 'name' => '科摩罗'],
    'KN' => ['en_name' => 'Saint Kitts and Nevis', 'name' => '圣基茨和尼维斯'],
    'KP' => ['en_name' => 'Korea (the Democratic People\'s Republic of)', 'name' => '朝鲜'],
    'KR' => ['en_name' => 'Korea (the Republic of)', 'name' => '韩国'],
    'KW' => ['en_name' => 'Kuwait', 'name' => '科威特'],
    'KY' => ['en_name' => 'Cayman Islands', 'name' => '开曼群岛'],
    'KZ' => ['en_name' => 'Kazakhstan', 'name' => '哈萨克斯坦'],
    'LA' => ['en_name' => 'Lao People\'s Democratic Republic', 'name' => '老挝'],
    'LB' => ['en_name' => 'Lebanon', 'name' => '黎巴嫩'],
    'LC' => ['en_name' => 'Saint Lucia', 'name' => '圣卢西亚'],
    'LI' => ['en_name' => 'Liechtenstein', 'name' => '列支敦士登'],
    'LK' => ['en_name' => 'Sri Lanka', 'name' => '斯里兰卡'],
    'LR' => ['en_name' => 'Liberia', 'name' => '利比里亚'],
    'LS' => ['en_name' => 'Lesotho', 'name' => '莱索托'],
    'LT' => ['en_name' => 'Lithuania', 'name' => '立陶宛'],
    'LU' => ['en_name' => 'Luxembourg', 'name' => '卢森堡'],
    'LV' => ['en_name' => 'Latvia', 'name' => '拉脱维亚'],
    'LY' => ['en_name' => 'Libya', 'name' => '利比亚'],
    'MA' => ['en_name' => 'Morocco', 'name' => '摩洛哥'],
    'MC' => ['en_name' => 'Monaco', 'name' => '摩纳哥'],
    'MD' => ['en_name' => 'Moldova, Republic of', 'name' => '摩尔多瓦'],
    'ME' => ['en_name' => 'Montenegro', 'name' => '黑山'],
    'MF' => ['en_name' => 'Saint Martin (French part)', 'name' => '法属圣马丁'],
    'MG' => ['en_name' => 'Madagascar', 'name' => '马达加斯加'],
    'MH' => ['en_name' => 'Marshall Islands', 'name' => '马绍尔群岛'],
    'MK' => ['en_name' => 'North Macedonia', 'name' => '北马其顿'],
    'ML' => ['en_name' => 'Mali', 'name' => '马里'],
    'MM' => ['en_name' => 'Myanmar', 'name' => '缅甸'],
    'MN' => ['en_name' => 'Mongolia', 'name' => '蒙古国'],
    'MO' => ['en_name' => 'Macao', 'name' => '澳门'],
    'MP' => ['en_name' => 'Northern Mariana Islands', 'name' => '北马里亚纳群岛'],
    'MQ' => ['en_name' => 'Martinique', 'name' => '马提尼克'],
    'MR' => ['en_name' => 'Mauritania', 'name' => '毛里塔尼亚'],
    'MS' => ['en_name' => 'Montserrat', 'name' => '蒙特塞拉特'],
    'MT' => ['en_name' => 'Malta', 'name' => '马耳他'],
    'MU' => ['en_name' => 'Mauritius', 'name' => '毛里求斯'],
    'MV' => ['en_name' => 'Maldives', 'name' => '马尔代夫'],
    'MW' => ['en_name' => 'Malawi', 'name' => '马拉维'],
    'MX' => ['en_name' => 'Mexico', 'name' => '墨西哥'],
    'MY' => ['en_name' => 'Malaysia', 'name' => '马来西亚'],
    'MZ' => ['en_name' => 'Mozambique', 'name' => '莫桑比克'],
    'NA' => ['en_name' => 'Namibia', 'name' => '纳米比亚'],
    'NC' => ['en_name' => 'New Caledonia', 'name' => '新喀里多尼亚'],
    'NE' => ['en_name' => 'Niger', 'name' => '尼日尔'],
    'NF' => ['en_name' => 'Norfolk Island', 'name' => '诺福克岛'],
    'NG' => ['en_name' => 'Nigeria', 'name' => '尼日利亚'],
    'NI' => ['en_name' => 'Nicaragua', 'name' => '尼加拉瓜'],
    'NL' => ['en_name' => 'Netherlands[note 1]', 'name' => '荷兰'],
    'NO' => ['en_name' => 'Norway', 'name' => '挪威'],
    'NP' => ['en_name' => 'Nepal', 'name' => '尼泊尔'],
    'NR' => ['en_name' => 'Nauru', 'name' => '瑙鲁'],
    'NU' => ['en_name' => 'Niue', 'name' => '纽埃'],
    'NZ' => ['en_name' => 'New Zealand', 'name' => '新西兰'],
    'OM' => ['en_name' => 'Oman', 'name' => '阿曼'],
    'PA' => ['en_name' => 'Panama', 'name' => '巴拿马'],
    'PE' => ['en_name' => 'Peru', 'name' => '秘鲁'],
    'PF' => ['en_name' => 'French Polynesia', 'name' => '法属波利尼西亚'],
    'PG' => ['en_name' => 'Papua New Guinea', 'name' => '巴布亚新几内亚'],
    'PH' => ['en_name' => 'Philippines', 'name' => '菲律宾'],
    'PK' => ['en_name' => 'Pakistan', 'name' => '巴基斯坦'],
    'PL' => ['en_name' => 'Poland', 'name' => '波兰'],
    'PM' => ['en_name' => 'Saint Pierre and Miquelon', 'name' => '圣皮埃尔和密克隆'],
    'PN' => ['en_name' => 'Pitcairn', 'name' => '皮特凯恩群岛'],
    'PR' => ['en_name' => 'Puerto Rico', 'name' => '波多黎各'],
    'PS' => ['en_name' => 'Palestine, State of', 'name' => '巴勒斯坦'],
    'PT' => ['en_name' => 'Portugal', 'name' => '葡萄牙'],
    'PW' => ['en_name' => 'Palau', 'name' => '帕劳'],
    'PY' => ['en_name' => 'Paraguay', 'name' => '巴拉圭'],
    'QA' => ['en_name' => 'Qatar', 'name' => '卡塔尔'],
    'RE' => ['en_name' => 'Réunion', 'name' => '留尼汪'],
    'RO' => ['en_name' => 'Romania', 'name' => '罗马尼亚'],
    'RS' => ['en_name' => 'Serbia', 'name' => '塞尔维亚'],
    'RU' => ['en_name' => 'Russian Federation', 'name' => '俄罗斯'],
    'RW' => ['en_name' => 'Rwanda', 'name' => '卢旺达'],
    'SA' => ['en_name' => 'Saudi Arabia', 'name' => '沙特阿拉伯'],
    'SB' => ['en_name' => 'Solomon Islands', 'name' => '所罗门群岛'],
    'SC' => ['en_name' => 'Seychelles', 'name' => '塞舌尔'],
    'SD' => ['en_name' => 'Sudan', 'name' => '苏丹'],
    'SE' => ['en_name' => 'Sweden', 'name' => '瑞典'],
    'SG' => ['en_name' => 'Singapore', 'name' => '新加坡'],
    'SH' => ['en_name' => 'Saint Helena', 'name' => '圣赫勒拿'],
    'SI' => ['en_name' => 'Slovenia', 'name' => '斯洛文尼亚'],
    'SJ' => ['en_name' => 'Svalbard and Jan Mayen', 'name' => '斯瓦尔巴和扬马延'],
    'SK' => ['en_name' => 'Slovakia', 'name' => '斯洛伐克'],
    'SL' => ['en_name' => 'Sierra Leone', 'name' => '塞拉利昂'],
    'SM' => ['en_name' => 'San Marino', 'name' => '圣马力诺'],
    'SN' => ['en_name' => 'Senegal', 'name' => '塞内加尔'],
    'SO' => ['en_name' => 'Somalia', 'name' => '索马里'],
    'SR' => ['en_name' => 'Suriname', 'name' => '苏里南'],
    'SS' => ['en_name' => 'South Sudan', 'name' => '南苏丹'],
    'ST' => ['en_name' => 'Sao Tome and Principe', 'name' => '圣多美和普林西比'],
    'SV' => ['en_name' => 'El Salvador', 'name' => '萨尔瓦多'],
    'SX' => ['en_name' => 'Sint Maarten (Dutch part)', 'name' => '荷属圣马丁'],
    'SY' => ['en_name' => 'Syrian Arab Republic', 'name' => '叙利亚'],
    'SZ' => ['en_name' => 'Eswatini', 'name' => '斯威士兰'],
    'TC' => ['en_name' => 'Turks and Caicos Islands', 'name' => '特克斯和凯科斯群岛'],
    'TD' => ['en_name' => 'Chad', 'name' => '乍得'],
    'TF' => ['en_name' => 'French Southern Territories', 'name' => '法属南部和南极领地'],
    'TG' => ['en_name' => 'Togo', 'name' => '多哥'],
    'TH' => ['en_name' => 'Thailand', 'name' => '泰国'],
    'TJ' => ['en_name' => 'Tajikistan', 'name' => '塔吉克斯坦'],
    'TK' => ['en_name' => 'Tokelau', 'name' => '托克劳'],
    'TL' => ['en_name' => 'Timor-Leste', 'name' => '东帝汶'],
    'TM' => ['en_name' => 'Turkmenistan', 'name' => '土库曼斯坦'],
    'TN' => ['en_name' => 'Tunisia', 'name' => '突尼斯'],
    'TO' => ['en_name' => 'Tonga', 'name' => '汤加'],
    'TR' => ['en_name' => 'Turkey', 'name' => '土耳其'],
    'TT' => ['en_name' => 'Trinidad and Tobago', 'name' => '特立尼达和多巴哥'],
    'TV' => ['en_name' => 'Tuvalu', 'name' => '图瓦卢'],
    'TW' => ['en_name' => 'Taiwan', 'name' => '中国台湾省'],
    'TZ' => ['en_name' => 'Tanzania, United Republic of', 'name' => '坦桑尼亚'],
    'UA' => ['en_name' => 'Ukraine', 'name' => '乌克兰'],
    'UG' => ['en_name' => 'Uganda', 'name' => '乌干达'],
    'UM' => ['en_name' => 'United States Minor Outlying Islands', 'name' => '美国本土外小岛屿'],
    'US' => ['en_name' => 'United States', 'name' => '美国'],
    'UY' => ['en_name' => 'Uruguay', 'name' => '乌拉圭'],
    'UZ' => ['en_name' => 'Uzbekistan', 'name' => '乌兹别克斯坦'],
    'VA' => ['en_name' => 'Holy See (Vatican City State)', 'name' => '梵蒂冈'],
    'VC' => ['en_name' => 'Saint Vincent and the Grenadines', 'name' => '圣文森特和格林纳丁斯'],
    'VE' => ['en_name' => 'Venezuela, Bolivarian Republic of', 'name' => '委内瑞拉'],
    'VG' => ['en_name' => 'Virgin Islands, British', 'name' => '英属维尔京群岛'],
    'VI' => ['en_name' => 'Virgin Islands, U.S.', 'name' => '美属维尔京群岛'],
    'VN' => ['en_name' => 'Viet Nam', 'name' => '越南'],
    'VU' => ['en_name' => 'Vanuatu', 'name' => '瓦努阿图'],
    'WF' => ['en_name' => 'Wallis and Futuna', 'name' => '瓦利斯和富图纳'],
    'WS' => ['en_name' => 'Samoa', 'name' => '萨摩亚'],
    'YE' => ['en_name' => 'Yemen', 'name' => '也门'],
    'YT' => ['en_name' => 'Mayotte', 'name' => '马约特'],
    'ZA' => ['en_name' => 'South Africa', 'name' => '南非'],
    'ZM' => ['en_name' => 'Zambia', 'name' => '赞比亚'],
    'ZW' => ['en_name' => 'Zimbabwe', 'name' => '津巴布韦'],
];

$zoneCodeMap = [
    "马来西亚" => "0060",
    "印度尼西亚" => "0062",
    "菲律宾" => "0063",
    "新加坡" => "0065",
    "泰国" => "0066",
    "文莱" => "00673",
    "日本" => "0081",
    "韩国" => "0082",
    "越南" => "0084",
    "朝鲜" => "00850",
    "香港" => "00852",
    "澳门" => "00853",
    "柬埔寨" => "00855",
    "老挝" => "00856",
    "中国" => "0086",
    "台湾" => "00886",
    "孟加拉国" => "00880",
    "土耳其" => "0090",
    "印度" => "0091",
    "巴基斯坦" => "0092",
    "阿富汗" => "0093",
    "斯里兰卡" => "0094",
    "缅甸" => "0095",
    "马尔代夫" => "00960",
    "黎巴嫩" => "00961",
    "约旦" => "00962",
    "叙利亚" => "00963",
    "伊拉克" => "00964",
    "科威特" => "00965",
    "沙特阿拉伯" => "00966",
    "阿曼" => "00968",
    "以色列" => "00972",
    "巴林" => "00973",
    "卡塔尔" => "00974",
    "不丹" => "00975",
    "蒙古" => "00976",
    "尼泊尔" => "00977",
    "伊朗" => "0098",
    "塞浦路斯" => "00357",
    "巴勒斯坦" => "00970",
    "阿联酋" => "00971",
    "也门" => "00967",
    "俄罗斯联邦" => "007",
    "希腊" => "0030",
    "荷兰" => "0031",
    "比利时" => "0032",
    "法国" => "0033",
    "西班牙" => "0034",
    "直布罗陀" => "00350",
    "葡萄牙" => "00351",
    "卢森堡" => "00352",
    "爱尔兰" => "00353",
    "冰岛" => "00354",
    "阿尔巴尼亚" => "00355",
    "马耳他" => "00356",
    "安道尔" => "00376",
    "芬兰" => "00358",
    "保加利亚" => "00359",
    "匈牙利" => "0036",
    "德国" => "0049",
    "南斯拉夫" => "00381",
    "意大利" => "0039",
    "圣马力诺" => "00378",
    "梵蒂冈" => "003906698",
    "罗马尼亚" => "0040",
    "瑞士" => "0041",
    "列支敦士登" => "00423",
    "奥地利" => "0043",
    "英国" => "0044",
    "丹麦" => "0045",
    "瑞典" => "0046",
    "挪威" => "0047",
    "波兰" => "0048",
    "捷克" => "00420",
    "斯洛伐克" => "00421",
    "摩纳哥" => "00377",
    "马其顿" => "00389",
    "科罗地亚" => "00385",
    "斯洛文尼亚" => "00386",
    "波斯尼亚和塞哥维那" => "00387",
    "亚美尼亚共和国" => "00374",
    "白俄罗斯共和国" => "00375",
    "格鲁吉亚共和国" => "00995",
    "哈萨克斯坦共和国" => "007",
    "吉尔吉斯坦共和国" => "00996",
    "乌兹别克斯坦共和国" => "00998",
    "塔吉克斯坦共和国" => "00992",
    "土库曼斯坦共和国" => "00993",
    "乌克兰" => "00380",
    "立陶宛" => "00370",
    "拉脱维亚" => "00371",
    "爱沙尼亚" => "00372",
    "摩尔多瓦" => "00373",
    "阿塞拜疆" => "00994",
    "埃及" => "0020",
    "摩洛哥" => "00212",
    "阿尔及利亚" => "00213",
    "突尼斯" => "00216",
    "利比亚" => "00218",
    "冈比亚" => "00220",
    "塞内加尔" => "00221",
    "毛里塔尼亚" => "00222",
    "马里" => "00223",
    "几内亚" => "00224",
    "科特迪瓦" => "00225",
    "布基拉法索" => "00226",
    "尼日尔" => "00227",
    "多哥" => "00228",
    "贝宁" => "00229",
    "毛里求斯" => "00230",
    "利比里亚" => "00231",
    "塞拉利昂" => "00232",
    "加纳" => "00233",
    "尼日利亚" => "00234",
    "乍得" => "00235",
    "中非" => "00236",
    "喀麦隆" => "00237",
    "佛得角" => "00238",
    "圣多美" => "00239",
    "普林西比" => "00239",
    "赤道几内亚" => "00240",
    "加蓬" => "00241",
    "刚果" => "00242",
    "扎伊尔" => "00243",
    "安哥拉" => "00244",
    "几内亚比绍" => "00245",
    "阿森松" => "00247",
    "塞舌尔" => "00248",
    "苏丹" => "00249",
    "卢旺达" => "00250",
    "埃塞俄比亚" => "00251",
    "索马里" => "00252",
    "吉布提" => "00253",
    "肯尼亚" => "00254",
    "坦桑尼亚" => "00255",
    "乌干达" => "00256",
    "布隆迪" => "00257",
    "莫桑比克" => "00258",
    "赞比亚" => "00260",
    "马达加斯加" => "00261",
    "留尼旺岛" => "00262",
    "津巴布韦" => "00263",
    "纳米比亚" => "00264",
    "马拉维" => "00265",
    "莱索托" => "00266",
    "博茨瓦纳" => "00267",
    "斯威士兰" => "00268",
    "科摩罗" => "00269",
    "南非" => "0027",
    "圣赫勒拿" => "00290",
    "阿鲁巴岛" => "00297",
    "法罗群岛" => "00298",
    "厄里特里亚" => "00291",
    "加那利群岛(西)(拉斯帕尔马斯)" => "003428",
    "加那利群岛(西)(圣克鲁斯)" => "003422",
    "迪戈加西亚" => "00246",
    "桑给巴尔" => "00259",
    "马约特岛" => "00269",
    "美国" => "001",
    "加拿大" => "001",
    "中途岛" => "001808",
    "夏威夷" => "001808",
    "威克岛" => "001808",
    "安圭拉岛" => "001264",
    "维尔京群岛" => "001340",
    "圣卢西亚" => "001758",
    "波多黎各" => "001809",
    "牙买加" => "001876",
    "巴哈马" => "001242",
    "巴巴多斯" => "001246",
    "阿拉斯加" => "001907",
    "格陵兰岛" => "00299",
    "安提瓜和巴布达" => "001268",
    "百慕大群岛" => "001441",
    "开曼群岛" => "001345",
    "多米尼加联邦" => "001767",
    "多米尼加共和国" => "001809",
    "格林纳达" => "001473",
    "蒙特塞拉特岛" => "001664",
    "荷属安的列斯群岛" => "00599",
    "波多黎哥" => "001787",
    "圣皮埃尔岛密克隆岛（法）" => "00508",
    "圣克里斯托弗和尼维斯" => "001869",
    "圣文森特岛（英）" => "001784",
    "特立尼达和多巴哥" => "001868",
    "特克斯和凯科斯群岛" => "001649",
    "瓜多罗普" => "00590",
    "福克兰群岛" => "00500",
    "伯利兹" => "00501",
    "危地马拉" => "00502",
    "萨尔瓦多" => "00503",
    "洪都拉斯" => "00504",
    "尼加拉瓜" => "00505",
    "哥斯达黎加" => "00506",
    "巴拿马" => "00507",
    "海地" => "00509",
    "秘鲁" => "0051",
    "墨西哥" => "0052",
    "古巴" => "0053",
    "阿根廷" => "0054",
    "巴西" => "0055",
    "智利" => "0056",
    "哥伦比亚" => "0057",
    "委内瑞拉" => "0058",
    "玻利维亚" => "00591",
    "圭亚那" => "00592",
    "厄瓜多尔" => "00593",
    "法属圭亚那" => "00594",
    "巴拉圭" => "00595",
    "马提尼克" => "00596",
    "苏里南" => "00597",
    "乌拉圭" => "00598",
    "澳大利亚" => "0061",
    "新西兰" => "0064",
    "关岛" => "001671",
    "科科斯岛" => "00619162",
    "诺福克岛" => "00672",
    "圣诞岛" => "00619164",
    "瑙鲁" => "00674",
    "汤加" => "00676",
    "所罗门群岛" => "00677",
    "瓦努阿图" => "00678",
    "斐济" => "00679",
    "科克群岛" => "00682",
    "纽埃岛" => "00683",
    "东萨摩亚" => "00684",
    "西萨摩亚" => "00685",
    "基里巴斯" => "00686",
    "图瓦卢" => "00688",
    "法属波里尼西亚、塔希提" => "00689",
    "马里亚纳群岛" => "001670",
    "新咯里多尼亚群岛" => "00687",
    "巴布亚新几内亚" => "00675",
    "帕劳" => "00680",
    "托克鲁" => "00690",
    "密克罗尼西亚" => "00691",
    "马绍尔群岛" => "00692",
    "瓦里斯和富士那群岛" => "001681",
];



$countries = R::find('countries');

foreach ($countries as $country) {
    $name = $country->name_cn;
    $data = $zoneCodeMap[$name] ?? '';
    if ($data) {
        $country->calling_code = ltrim($data, '0');
        R::store($country);
    }
}


/**
 * BS: +1242
 * BB: +1246
 * AI: +1264
 * AG: +1268
 * VG: +1284
 * VI: +1340
 * KY: +1345
 * BM: +1441
 * GD: +1473
 * TC: +1649
 * JM: +1658
 * MS: +1664
 * MP: +1670
 * GU: +1671
 * AS: +1684
 * SX: +1721
 * LC: +1758
 * DM: +1767
 * VC: +1784
 * PR: +1787
 * DO: +1809
 * DO: +1829
 * DO: +1849
 * TT: +1868
 * KN: +1869
 * JM: +1876
 * PR: +1939
 * EG: +20
 * ZA: +27
 * SS: +211
 * MA,EH: +212
 * DZ: +213
 * TN: +216
 * LY: +218
 * GM: +220
 * SN: +221
 * MR: +222
 * ML: +223
 * GN: +224
 * CI: +225
 * BF: +226
 * NE: +227
 * TG: +228
 * BJ: +229
 * MU: +230
 * LR: +231
 * SL: +232
 * GH: +233
 * NG: +234
 * TD: +235
 * CF: +236
 * CM: +237
 * CV: +238
 * ST: +239
 * GQ: +240
 * GA: +241
 * CG: +242
 * CD: +243
 * AO: +244
 * GW: +245
 * IO: +246
 * AC: +247
 * SC: +248
 * SD: +249
 * RW: +250
 * ET: +251
 * SO: +252
 * DJ: +253
 * KE: +254
 * TZ: +255
 * UG: +256
 * BI: +257
 * MZ: +258
 * ZM: +260
 * MG: +261
 * RE,YT,TF: +262
 * ZW: +263
 * NA: +264
 * MW: +265
 * LS: +266
 * BW: +267
 * SZ: +268
 * KM: +269
 * SH,TA: +290
 * ER: +291
 * AW: +297
 * FO: +298
 * GL: +299
 * GR: +30
 * NL: +31
 * BE: +32
 * FR: +33
 * ES: +34
 * HU: +36
 * IT,VA: +39
 * GI: +350
 * PT: +351
 * LU: +352
 * IE: +353
 * IS: +354
 * AL: +355
 * MT: +356
 * CY: +357
 * FI,AX: +358
 * BG: +359
 * LT: +370
 * LV: +371
 * EE: +372
 * MD: +373
 * AM: +374
 * BY: +375
 * AD: +376
 * MC: +377
 * SM: +378
 * VA: +379
 * UA: +380
 * RS: +381
 * ME: +382
 * XK: +383
 * HR: +385
 * SI: +386
 * BA: +387
 * MK: +389
 * RO: +40
 * CH: +41
 * AT: +43
 * GB,GG,IM,JE: +44
 * DK: +45
 * SE: +46
 * NO,SJ,BV: +47
 * PL: +48
 * DE: +49
 * CZ: +420
 * SK: +421
 * LI: +423
 * PE: +51
 * MX: +52
 * CU: +53
 * AR: +54
 * BR: +55
 * CL: +56
 * CO: +57
 * VE: +58
 * FK,GS: +500
 * BZ: +501
 * GT: +502
 * SV: +503
 * HN: +504
 * NI: +505
 * CR: +506
 * PA: +507
 * PM: +508
 * HT: +509
 * GP,BL,MF: +590
 * BO: +591
 * GY: +592
 * EC: +593
 * GF: +594
 * PY: +595
 * MQ: +596
 * SR: +597
 * UY: +598
 * BQ,CW: +599
 * MY: +60
 * AU,CX,CC: +61
 * ID: +62
 * PH: +63
 * NZ,PN: +64
 * SG: +65
 * TH: +66
 * TL: +670
 * NF,AQ,HM: +672
 * BN: +673
 * NR: +674
 * PG: +675
 * TO: +676
 * SB: +677
 * VU: +678
 * FJ: +679
 * PW: +680
 * WF: +681
 * CK: +682
 * NU: +683
 * WS: +685
 * KI: +686
 * NC: +687
 * TV: +688
 * PF: +689
 * TK: +690
 * FM: +691
 * MH: +692
 * RU,KZ: +7
 * RU: +73
 * RU: +74
 * KZ: +76
 * KZ: +77
 * RU: +78
 * RU: +79
 * JP: +81
 * KR: +82
 * VN: +84
 * CN: +86
 * XT: +800
 * XS: +808
 * KP: +850
 * HK: +852
 * MO: +853
 * KH: +855
 * LA: +856
 * XN: +870
 * XP: +878
 * BD: +880
 * XG: +881
 * XV: +882
 * XV: +883
 * TW: +886
 * TR,CT: +90
 * IN: +91
 * PK: +92
 * AF: +93
 * LK: +94
 * MM: +95
 * IR: +98
 * MV: +960
 * LB: +961
 * JO: +962
 * SY: +963
 * IQ: +964
 * KW: +965
 * SA: +966
 * YE: +967
 * OM: +968
 * PS: +970
 * AE: +971
 * IL: +972
 * BH: +973
 * QA: +974
 * BT: +975
 * MN: +976
 * NP: +977
 * XR: +979
 * XC: +991
 * TJ: +992
 * TM: +993
 * AZ: +994
 * GE: +995
 * KG: +996
 * KZ: +997
 * UZ: +998
 */